# --------------------------------------------------------
#  Copyright (C) 2004-2020 by EMGU Corporation. All rights reserved.
# --------------------------------------------------------

IF(EMGU_CV_BUILD OR EMGU_CV_EXAMPLE_BUILD)

PROJECT(Emgu.CV)
#IF(NOT ANDROID)
#  FILE(GLOB_RECURSE SRC_CV RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cs")
#  LIST(APPEND SRC_CV ${CMAKE_CURRENT_SOURCE_DIR}/../CommonAssemblyInfo.cs)

  #Remove unity related files
#  FILE(GLOB_RECURSE SRC_CV_EXCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "PInvoke/Unity/*.cs" "PInvoke/iOS/libemgucv.linkwith.cs")

#  LIST(REMOVE_ITEM SRC_CV ${SRC_CV_EXCLUDES})
  
#  GENERATE_DOCUMENT(${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME})
#  SIGN_ASSEMBLY(${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV.snk)
#  SET_CS_TARGET_FRAMEWORK(${CSC_TARGET_FRAMEWORK})
#  ADD_CS_REFERENCES("${LIBRARY_OUTPUT_PATH}/Emgu.Util.dll")
#  COMPILE_CS(${PROJECT_NAME} "library" "${SRC_CV}" ALL)
#  INSTALL(
#  FILES 
#  ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll
#  ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.xml
#  DESTINATION ${CPACK_PACKAGE_CLI_FOLDER}
#  COMPONENT emgucv_binary)
#  if(ENABLE_SOLUTION_FOLDERS)
#    set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "emgu")
#endif()

#ADD_DEPENDENCIES(${PROJECT_NAME} Emgu.Util cvextern)
#ENDIF()

#INSTALL(
#  FILES 
#  ${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV.License.txt
#  DESTINATION ${CPACK_PACKAGE_CLI_FOLDER}
#  COMPONENT emgucv_binary)

#IF(WIN32 OR APPLE OR ANDROID)
#IF(NETFX_CORE OR ANDROID)
  INSTALL(
	  DIRECTORY
	  ${CMAKE_CURRENT_SOURCE_DIR}
	  DESTINATION .
		COMPONENT emgucv_source
	  FILES_MATCHING 
	  PATTERN "*.cs"
	  PATTERN "*.shproj"
	  PATTERN "*.projitems"
	  PATTERN "*.resx"
	  PATTERN "README.txt"
	  PATTERN ".svn" EXCLUDE
	  PATTERN "obj" EXCLUDE
	  PATTERN "CMakeFiles" EXCLUDE
	  PATTERN "${PROJECT_NAME}.dir" EXCLUDE
	  PATTERN "*Unity*" EXCLUDE
	)
#ELSE()
#  INSTALL(
#	  DIRECTORY
#	  ${CMAKE_CURRENT_SOURCE_DIR}
#	  DESTINATION .
#		COMPONENT emgucv_source
#	  FILES_MATCHING 
#	  PATTERN "*.cs"
#	  PATTERN "${PROJECT_NAME}.csproj"
#	  PATTERN "*.resx"
#	  PATTERN "README.txt"
#	  PATTERN ".svn" EXCLUDE
#	  PATTERN "obj" EXCLUDE
#	  PATTERN "CMakeFiles" EXCLUDE
#	  PATTERN "${PROJECT_NAME}.dir" EXCLUDE
#	  PATTERN "*Android*" EXCLUDE
#	  PATTERN "*iOS*" EXCLUDE
#	  PATTERN "*Unity*" EXCLUDE
#	  PATTERN "*System.Drawing*" EXCLUDE
#	)
#ENDIF()
#ENDIF()

ENDIF()
